﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ApplyMgr.aspx.cs" Inherits="Announcement.Admin.ApplyMsg" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="../css/Default.css" rel="stylesheet" type="text/css" />
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <header id="top">
		<div class="wrapper">
			<!-- Title/Logo - can use text instead of image -->
			<div id="title">
			<a href="../Admin/ApplyMgr.aspx">
			<img SRC="../img/lzfcjys_logo.png" alt="lzfcjys" />
			</a>
			</div>
			<!-- Top navigation -->
			<div id="topnav">
				<a href="#"><img class="avatar" SRC="../img/user_32.png" alt="" /></a>
				Logged in as <b>admin</b>
				<span>|</span> <asp:LinkButton ID="lbtnExit" runat="server" 
                    onclick="lbtnExit_Click">退出</asp:LinkButton>
			</div>
			
			
			<!-- End of Aside links -->
		</div>
	</header>
    <div id="pagetitle">
        <div class="wrapper">
            <h1>
                首页</h1>
        </div>
    </div>
    
    <div id="mainbox">
        <asp:ObjectDataSource ID="odsApply" runat="server" 
            SelectMethod="GetApplyMgr" 
            TypeName="Announcement.DAL.DataSetApplyMgrTableAdapters.ApplyMgrTableAdapter" 
            DeleteMethod="DeleteById">
            <DeleteParameters>
                <asp:Parameter Name="Id" Type="Int64" />
            </DeleteParameters>
        </asp:ObjectDataSource>
        
        <asp:ObjectDataSource ID="odsApplyType" runat="server" DeleteMethod="Delete" 
            InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="GetData" 
            TypeName="Announcement.DAL.DataSetApplyTypeTableAdapters.T_ApplyTypeTableAdapter" 
            UpdateMethod="Update">
            <DeleteParameters>
                <asp:Parameter Name="Original_Id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Type_Name" Type="String" />
                <asp:Parameter Name="Original_Id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Id" Type="Int32" />
                <asp:Parameter Name="Type_Name" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        
        <table width="100%" class="stylized">
            <tr align="center">
                <th>公告编号</th>
                <th>房屋坐落</th>
                <th>申请类型</th>
                <th>申请时间</th>
                <th></th>
            </tr>
            <tr>
                <td><asp:TextBox ID="txtCCode" runat="server" Width="90px"></asp:TextBox></td>
                <td><asp:TextBox ID="txtLocal" runat="server"></asp:TextBox></td>
                <td>
                    <asp:DropDownList ID="ddlApplyType" runat="server" DataSourceID="odsApplyType" 
                        DataTextField="Type_Name" DataValueField="Id" 
                        ondatabound="ddlApplyType_DataBound">
                    </asp:DropDownList>
                </td>
                <td>从<asp:TextBox ID="txtStartDate" runat="server" Width="70px" onclick="WdatePicker()"></asp:TextBox>到
                <asp:TextBox ID="txtEndDate" runat="server" Width="70px" onclick="WdatePicker()"></asp:TextBox></td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" class="btn" Text="搜索" onclick="btnSearch_Click" />
                </td>
            </tr>
        </table>
        
       
        
        <asp:ListView ID="lvApplyMgr" runat="server" DataKeyNames="Id" 
            DataSourceID="odsApply" onitemcommand="lvApplyMgr_ItemCommand" 
            onpagepropertieschanging="lvApplyMgr_PagePropertiesChanging">
            <ItemTemplate>
                <tr>
                    <asp:HiddenField ID="hfId" runat="server" Value='<%# Eval("Id") %>' />
                    <td>
                        <asp:Label ID="ApplicantLabel" runat="server" Text='<%# Eval("ContractCode") %>' Width="60px"/>
                    </td>
                    <td>
                        <asp:Label ID="LegalLabel" runat="server" Text='<%# Eval("Applicant") %>' Width="30px"/>
                    </td>
                    <td>
                        <asp:Label ID="HouseNumLabel" runat="server" 
                            Text='<%# Eval("HouseLocated").ToString().Length>8?Eval("HouseLocated").ToString().Substring(0,8)+"...":Eval("HouseLocated") %>' 
                            Width="150px"/>
                    </td>
                    <td>
                        <asp:Label ID="Type_NameLabel" runat="server" 
                        Text='<%# Eval("Type_Name").ToString().Length>10?Eval("Type_Name").ToString().Substring(0,10)+"...":Eval("Type_Name") %>' 
                        Width="160px"/>
                    </td>
                    <td>
                        <asp:Label ID="ApplyDateLabel" runat="server" Text='<%# Eval("ApplyDate","{0:yyyy-MM-dd}")%>' Width="75px" />
                    </td>
                    <td>
                        <asp:CheckBox ID="IsPayCheckBox" runat="server" Checked='<%# Eval("IsPay") %>' 
                            Enabled="false" />
                    </td>
                    <td>
                        <asp:Button ID="btnRead" runat="server" class="btn btn-green" CommandName="Read" Text="查看" />
                        <asp:Button ID="btnEdit" runat="server" class="btn btn-blue" CommandName="Edit" Text="编辑" />
                        <asp:Button ID="DeleteButton" runat="server" class="btn btn-red" CommandName="Delete" Text="删除" OnClientClick="return confirm('确定将此记录删除?')"/>
                    </td>
                </tr>
            </ItemTemplate>
            
            <EmptyDataTemplate>
                <table runat="server" class="stylized">
                    <tr>
                        <td>
                            未返回数据，
                            <asp:LinkButton ID="lbtnAdd" runat="server" Text="点击这里" PostBackUrl="~/Admin/ApplyEdit.aspx?mode=add"/>
                            新增数据。
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <LayoutTemplate>
                
                            <table ID="itemPlaceholderContainer" runat="server" width="100%" class="stylized">
                                <tr>
                                    <th runat="server">
                                        公告编号</th>
                                    <th runat="server">
                                        申请人</th>
                                    <th runat="server">
                                        房屋坐落</th>
                                    <th runat="server">
                                        申请类型</th>
                                    <th runat="server">
                                        申请时间</th>
                                    <th runat="server">
                                        是否付费</th>
                                    <th runat="server" style="width:170px; text-align:right;">
                                        <asp:LinkButton ID="lbtnAdd" runat="server" PostBackUrl="~/Admin/ApplyEdit.aspx?mode=add" class="btn">
                                            <span class="icon icon-add"></span>新增
                                        </asp:LinkButton>
                                    </th>
                                </tr>
                                <tr ID="itemPlaceholder" runat="server">
                                </tr>
                            </table>
                            <center>
                            <p class="pagination">
                                <asp:DataPager ID="DataPager1" runat="server">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="false" ShowNextPageButton="false" ShowPreviousPageButton="true" FirstPageText="|<<" PreviousPageText="<<"/>
                                        <asp:NumericPagerField ButtonType="Link" ButtonCount="5" CurrentPageLabelCssClass="pagination-active" />
                                        <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="false" ShowPreviousPageButton="false" ShowNextPageButton="true" LastPageText=">>|" NextPageText=">>"/>
                                    </Fields>
                                </asp:DataPager>
                            </p>
                            </center>
            </LayoutTemplate>
        </asp:ListView>
        
        
    
    </div>
    
    <footer id="bottom">
		<div class="wrapper">
			<p>Copyright &copy; 2010 <b><a href="http://www.lzfcjys.com" title="www.lzfcjys.com">www.lzfcjys.com</a></b> | Icons by <a href="http://www.lzfcjys.com">柳州市房产交易管理网</a></p>
		</div>
	</footer>
	</form>
</body>
</html>
